var CTWApp = cc.Application.extend({
	_config:document.ccConfig,
	
	ctor:function(scn){
		this._super();
		this._startScn = scn;
		cc.COCOS2D_DEBUG = this._config.COCOS2D_DEBUG;
		cc.initDebugSetting();
		cc.setup(this._config['tag']);
		
		cc.Loader.getInstance().onloading = function(){
			cc.LoaderScene.getInstance().draw();
		}
		cc.Loader.getInstance().onload = function(){
			cc.AppController.shareAppController().didFinishLaunchingWithOptions();
		}
		cc.Loader.getInstance().preload(G_LOGIN_SCN_RES);
	},
	
	applicationDidFinishLaunching:function(){
		var director = cc.Director.getInstance();
		director.setDisplayStats(this._config.showFPS);
		director.setAnimationInterval(1.0/this._config.fps);
		director.runWithScene(new this._startScn());
		return true;
	}
});

var app = new CTWApp(LoginScn);

function rl(){
	location.reload(true);
}
var fi = 1;
function rlf(f){
	var head = document.getElementsByTagName('head').item(0);
	var stag = document.createElement('script');
	stag.type = 'text/javascript';
	stag.src = f + '?' + fi;
	fi += 1;
	head.appendChild(stag);
}